import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import qiankun from "vite-plugin-qiankun";

// https://vite.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    qiankun("secondApp", {
      // 子应用名称，与主应用注册的一致
      useDevMode: true,
    }),
  ],
  server: {
    port: 5174,
    origin: "//localhost:5174",
    cors: true,
    headers: {
      "Access-Control-Allow-Origin": "*",
    },
  },
  // 确保子应用可以被正确识别为模块
  base: "/",
});
